<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
<!-- member-source-subsource 展开 -->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/dayDataPartner/expandCloseRange.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/dayDataPartner/expandCloseRangeMember.js"></script>
<!-- member-source-subsource 展开 -->


<style>
#content{ min-height:600px;_height:600px;}

.table td{ text-align:right;white-space:nowrap;}
.table .textLeft{ text-align:left;}
.table .count td{ text-align:right;}
.table .count .textCenter { text-align: center;}
.table .member-data-body .textLeft{ text-align:left;}
</style>

</head>
<body style="overflow:auto;">
<div id="main">
	<div id="topMenu">
		<div id="navigation">当前位置：<?php echo $this->title;?></div>
		<div id="topOtherMenu"></div>
	</div>
	<div id="body">
		<div id="search">
			 <form id="searchForm" name="searchForm" method="post" 
            action="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'between'));?>">
				<!-- 时间选择条 -->
				<div id="timeRange">
                 <a  <?php if($this->key=='today'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'today','doType'=>$this->vars['doType']));?>">今天</a>
					  <a  <?php if($this->key=='yestoday'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'yestoday','doType'=>$this->vars['doType']));?>">昨天</a>
                  
                    <a  <?php if($this->key=='last-seven-day'):?>
                 class="currentTimeRange"
                 <?php endif;?>  href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-seven-day','doType'=>$this->vars['doType']));?>">最近7天</a>
                  <a  <?php if($this->key=='last-thirty-day'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-thirty-day','doType'=>$this->vars['doType']));?>">最近30天</a>
                   <a  <?php if($this->key=='last-three-month'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-three-month','doType'=>$this->vars['doType']));?>">最近三个月</a> &nbsp;
                    <span  <?php if($this->key=='between'):?>
                 class="currentTimeRange"
                 <?php endif;?>
                
                >日期选择</span>：<input name="startTime" type="text" class="input" id="startTime" size="10" value="<?php echo $this->startTime;?>" />
                    <script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script>
-
<input name="endTime" type="text" class="input" id="endTime" size="10" value="<?php echo $this->endTime;?>" />
<br /><br />渠道选择：

<select name="memberName" id="memberName" style="width:100px;">
<option value="">渠道选择</option>
<?php foreach($this->members as $member):?>
<option value="<?php echo $member;?>" 
<?php if ($this->memberName == $member):?>
selected="selected"
<?php endif;?>
><?php echo $member;?></option>
<?php endforeach;?>
</select>

操作系统：
<select name="osName" id="osName">
<option value="">操作系统</option>
<?php foreach($this->osNames as $osName):?>
<option value="<?php echo $osName;?>" 
<?php if ($this->osName == $osName):?>
selected="selected"
<?php endif;?>
><?php echo $osName;?></option>
<?php endforeach;?>
</select>    


<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"endTime","button":"endTime"});</script>
                <input name="searchBtn" type="button" id="searchBtn" value="查找" class="button" />
                &nbsp; <a name="exportBtn" id="exportBtn" style="background:none; padding-left:0px; padding-top:2px; padding-bottom:2px; text-decoration:none;" >[输出Excel文件]</a></div>
				<!-- 时间选择条 -->	
                		 <input name="expandDayUrl" value="<?php echo $this->projectUrl(array('action'=>'expand-Day'));?>" type="hidden" id="expandDayUrl" />
                <input name="expandAdMemberUrl" id="expandAdMemberUrl" type="hidden" value="<?php echo $this->projectUrl(array('action'=>'expand-ad-member'));?>" />
                <input name="expandFreeMemberUrl" id="expandFreeMemberUrl" type="hidden" value="<?php echo $this->projectUrl(array('action'=>'expand-free-member'));?>" />
                 <input type="hidden" id="expandAdMemberSourceUrl" name="expandAdMemberSourceUrl"  value="<?php echo $this->projectUrl(array('action'=>'ad-member-source'));?>" />
                  <input type="hidden" id="freeAdMemberSourceUrl" name="freeAdMemberSourceUrl" value="<?php echo $this->projectUrl(array('action'=>'free-member-source'));?>" 
                />
                 <!-- 按照广告类型分得算法 -->
               
                <!-- 按照渠道分得算法 -->
                <input name="expandAllMemberUrl" id="expandAllMemberUrl" type="hidden" value="<?php echo $this->projectUrl(array('action'=>'expand-all-member'));?>" />
                <input type="hidden" id="expandAllMemberSourceUrl" name="expandAllMemberSourceUrl"  value="<?php echo $this->projectUrl(array('action'=>'all-member-source'));?>" />
                <!-- 按照渠道分得算法-->
                
              <!-- 标签选择 -->
               <input name="day" type="hidden" value="<?php echo $this->key;?>" />
               <input type="hidden" name="doType" id="doType" value="<?php echo $this->vars['doType'];?>" />  
              <!-- 标签选择 -->
		  </form>
		</div>

		<div id="content">		
			<!--content start-->
				<div class="d-title">
                 <!-- 按照渠道分类 
				<a href="javascript:void(0);" onclick="selData('<?php echo $this->projectUrl(array('action'=>'op-report','day'=>$this->key,'doType'=>1)) ;?>',1);" class="<?php echo $this->vars['doType']==1 ? 'on' : ''?>">按广告分</a>
               
				<a href="javascript:void(0);" onclick="selData('<?php echo $this->projectUrl(array('action'=>'op-report','day'=>$this->key,'doType'=>2)) ;?>',2);" class="<?php echo $this->vars['doType']==2 ? 'on' : ''?>">按渠道分</a>
                -->
				<div  style="clear:both;"></div>
				</div>
				
				<span class="d-line"></span>
                <form id="listForm" name="listForm" method="post" action="">
           <table class="table reportTable" >
           <tr class="subject">
            <td width="100px"><div align="center">日期</div></td>
           <?php if ($this->vars['doType']==1):?>
           <td>ROI</td>
             <td>订单金额</td>
             <td>订单量</td>
             <td>客单价</td>
             <td>广告成本</td>
           <?php else:?>
           
			<td width="80px">ROI</td>
			<td>当天总提交订单金额</td>
			<td>当天总提交订单量</td>
			<td>客单价</td>
			<td>广告成本</td>
            <?php endif;?>
           </tr>
           <?php if (is_array($this->rows)):?>
           <?php $day = 0; $i = strtotime($this->endTime);?>
            <?php foreach($this->rows as $num=>$row):?>
            <?php ++$day;?>
          <tr class="dataLine data-show-<?php echo $day%2;?>">
          <?php foreach ($row as $key=>$val):?>
          <?php if ($key == 'date'):?>
          <td>
          
            <div align="left">
            <?php if ($num != count($this->rows)-1):?>
                <span style="cursor:pointer;" 
               class="<?php 
                      if ($this->vars['doType'] == 1) {
                        echo 'expandDay';
                      } else {
                        echo 'expandAllMember';
                      }
                     ?>"
              
               startTime="<?php echo $i;?>" id="expandDay_<?php echo $i;?>">+</span>&nbsp;
		   <?php endif;?>
		   <?php echo $row['date'];?></div></td>
           <?php else:?>
            <td style="text-align:right;"><?php echo $val;?></td>
           <?php endif;?>
           
           <?php endforeach;?>
          </tr>
            <tr><td colspan="20" style=" padding:0px 0px;" id="dayDataTd_<?php echo $i;?>"></td></tr>
            <?php  $i = $i - 60*60*24;?>
             <?php endforeach;?>    
             <?php else:?>
             <tr><td  colspan="20">没有找到任何记录！</td></tr>
             <?php endif;?>
</table>
</form>
					
		</div>
			
			
			
			
				
				
				
				
	</div>
	</div>
</div>
<script>
function selData(action,doType){
    $('#searchForm').attr('action', action);
	$('#doType').attr('value', doType);
    $('#searchForm').submit();
}
    $(function(){
		$("#searchBtn").click(function(){
			$("#searchForm").attr("action","<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'between'));?>");
			$("#searchForm").submit();
		})
		$("#exportBtn").click(function(){
			$("#searchForm").attr("action","<?php echo $this->projectUrl(array('action'=>'export-report','day'=>$this->key));?>");
			$("#searchForm").submit();
		})
	})
</script>
</body>
</html>